migrant_lib
Embeddable migration management
migrant_lib
allows defining and embedding management of migrations in your compiled application.
Migrations can be defined as files or functions. Migrations can be either read from
files at runtime or embedded in your executable at compile time.
Migration tags must all be unique. Function migrations must have the signature
fn(DbConn) -> Result<(), Box<std::error::Error>>
. See the
embedded/programmable example
for a working sample. When working with migrations, the respective database feature must
be enabled (postgresql
/ sqlite
). The entirety of the database-specific connection library will
be re-exported in the types
module.
.use_migrations?;
config
Migrations management identical to the migrant
cli tool can also be embedded.
This method only supports file-base migrations generated by migrant_lib
(or migrant
cli). See the
migrant-cli-compatible example
for a working sample.
License: MIT